﻿using AMM.Model;
using AMM.Model.Store;

namespace AMM.UserControls {
    public partial class ProductInventorySearchControl : BaseSearchControl {

        public override BaseSearchModel GetSearchModel() {
            ProductInventorySearchModel searchResult = new ProductInventorySearchModel();
            searchResult.ProductCode = this.tbProductCode.Text;
            searchResult.StoreBasisCode = this.tbStoreBasis.Text;
            searchResult.ProductInStoreDateStart = this.GetDateTimePickerValue(this.dtpCreateStart);
            searchResult.ProductInStoreDateEnd = this.GetDateTimePickerValue(this.dtpCreateEnd);

            return searchResult;
        }

        public override void ResetSearchModel() {
            this.tbProductCode.Clear();
            this.tbStoreBasis.Clear();
            this.dtpCreateStart.Checked = false;
            this.dtpCreateEnd.Checked = false;
        }

        public ProductInventorySearchControl() {
            this.InitializeComponent();
        }
    }
}
